﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ArticleListViewModel>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if (Model.Articles != null && Model.Articles.Count > 0)
     {
         var first = Model.Articles[0];
         var catid = first.CatID;  %>
<div class="box_r" style="margin-bottom: 5px;">
	<div class="box_hd_r">
	    <a href="/article/index/<%=catid %>"><%=ViewData["Title"] %></a>
	</div>
    <div class="tv_tivi" style="padding:3px">
        <a href="/article/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>">
            <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 266, 186, first.ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
            <img src="<%=imgPath %>" title="<%=first.Title %>" alt="<%=first.Title %>" class="bor_img" width="266" height="186" style="overflow:hidden"/>
        </a>
        <h3><a href="/article/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>" class="link_org"><%=Html.Encode(first.Title) %></a></h3>
    </div>  
    <div class="new_list">
        <%if (Model.Articles.Count > 1)
        { %>
        <ul>
          <%for(int i=1;i<Model.Articles.Count; i++){
             %>
            <li><a href="/article/details/<%=Model.Articles[i].ID %>/<%=Html.ToUrlFriendly(Model.Articles[i].Title)%>"><%=Html.Encode(Model.Articles[i].Title)%></a></li>              
           <%} %>
        </ul>
      <%} %>
    </div>
</div>
<%} %>


